<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
</style>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>

<div class="span10">
    <div style="margin-bottom: 20px;">
        <a href="/index/index">首页</a><span >&gt;</span><span>书本管理</span><span >&gt;</span><span>添加/修改</span>
    </div>
    <form name="form" method="post" action="<?php echo baseUrl."/content/book/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td>name *:</td>
                <td>
                    <input  type="text" name="name" value="<?php echo isset($data)? $data['name']:''?>" />
                </td>
            </tr>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原图片:</td>';
                $str .= '<td>';
                $pic = $data['pic'];
                $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                echo $str;
            } ?>

            <tr>
                <td width="120px">上传、修改图片 *:</td>
                <td>
                    <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr>
                <td>简介:</td>
                <td>
                    <textarea name="keyword"><?php echo isset($data)? $data['keyword']:''?></textarea>
                </td>
            </tr>
            <tr>
                <td>内容：</td>
                <td id="introduction">
                  <textarea style="width: 800px" id="editor" class="editor"
                            name="introduction"></textarea>
                    <script>var editor = UE.getEditor('editor');</script>
                </td>
            </tr>
            <tr>
                <td>颜色:</td>
                <td>
                    <input  type="text" name="colour" value="<?php echo isset($data)? $data['colour']:''?>" />
                </td>
            </tr>
            <tr>
                <td>排序:</td>
                <td>
                    <input  type="text" name="sort" value="<?php echo isset($data)? $data['sort']:''?>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button></td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>

</div>